package models

import (
	"fmt"
	"github.com/go-redis/redis"
	"zhice/conf"
)

var Rdb *redis.Client

func RedisInit() {
	Rdb = redis.NewClient(&redis.Options{
		Addr:     conf.AppConfig.RedisConfig.Host2,
		Password: conf.AppConfig.RedisConfig.Password2,
	})
	err = Rdb.Ping().Err()
	if err != nil {
		fmt.Println("redis链接失败")
		return
	} else {
		fmt.Println("redis连接成功")
	}
}
